package com.miao.FeignClient;

import com.miao.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

//加入配置文件，使得能够传输Multipart文件
@FeignClient(value = "media-api", configuration = {MultipartSupportConfig.class}, fallbackFactory = fallbackFactoryOfMeida.class)
public interface MediaServiceClient {

    @PostMapping(value = "/media/upload/coursefile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public String fuck(@RequestPart("filedata") MultipartFile multipartFile, @RequestParam(value = "objectname", required = false)String objectname) throws Exception;

    }
